#pragma once

#include "muduo/base/ThreadPool.h"
#include "pose_detector/pose_detector_ihs.h"
#include "reid/reid.h"

#include <rclcpp/rclcpp.hpp>

#include <unordered_map>

namespace perception::camera {

class CameraDetectors {
public:
    CameraDetectors(int num, std::string model_path);
    ~CameraDetectors();

    std::unordered_map<std::string, std::vector<perception::camera::ObjectDetectInfoPtr>>
    process(std::unordered_map<std::string, cv::Mat>& images);

private:
    muduo::ThreadPool pool_;
    const std::string model_path_;
    thread_local static std::shared_ptr<PoseDetectorIhs> detector_;
    std::shared_ptr<ReID> reid_;
    std::mutex reid_lock_;
    rclcpp::Logger logger_;
};

}
